<?php

class PublicController
{
	public $smarty;
	function __construct()
    {    	    	
    	global $smarty, $cf_module, $cf_controller, $cf_action;    	
    	if(!method_exists($this, $cf_action)){
    		echo '页面不存在-pub';die;    		    
    	}

    	$this->smarty = $smarty;
    	// 模块位置
    	$this->smarty->mypage($cf_controller.'/'.$cf_action, '', 0);
    	// 静态文件位置
    	$STATIC['__JS__'] = '/public/static/'.$cf_module.'/js';
    	$STATIC['__CSS__'] = '/public/static/'.$cf_module.'/css';
    	$STATIC['__IMG__'] = '/public/static/'.$cf_module.'/img';
        $STATIC['ttt'] = time();
    	$this->smarty->assign($STATIC);
    	// 运行
    	$this->$cf_action();    	    	    	    	
    }
}


